{% extends "light.twig" %}

{% block content %}
  {% include 'vocab-search-nav-bar.twig' %}
  
   <div id="alphabetical-search-listing-container">
      <div class="alphabetical-headers">
        <span class="header-text-font">{% trans "Aakkosellinen hakemisto" %}</span>
        {% set letters = 'A'..'Z' %} {# it would be nicer to do this according to the actual appearances of letters i.e. only letters with results should be shown #}
        {% set rest = ['Å', 'Ä', 'Ö', '!*'] %}
	  
  	 <div id="alphabetical-indexing">
	    {% for letter in [['0-9'], letters, rest] %} {# looping through all letters #}
	       {%  for letter2 in letter %}
	        <a {% if search_letter == letter2 %} class="highlight" {% endif %}href="{{ path_fix }}{{ vocab_id }}/{{ lang }}/index/{{ letter2 }}">{{ letter2 }}</a>
	       {% endfor %}
	    {% endfor %}
	    </div>    
	          </div>
	    {% if search_results %}
  	    <div class="wide">
  	    {% for key,value in search_results %}
  	       <div class="alphabetical-search-result">
  	      {% if value.altlabel %}
  	         {{ value.altlabel }} 	&rarr; <a href="{{ path_fix }}{{ value.vocab }}/{{ lang }}/page/{% if 'http' in value.uri %}?uri={{ value.uri }}{% endif %}">{{ value.label }}</a>
  	      {% else %}
  	          <a href="{{ path_fix }}{{ value.vocab }}/{{ lang }}/page/{% if 'http' in value.uri %}?uri={{ value.uri }}{% endif %}">{{ value.label }}</a>
  	      {% endif %}
  	      </div>
      			
    		{% endfor %}
    		</div>
    		{% else %}<span class="header-text-small-font">Virhe: Sanastosta ei löytynyt tuloksia pyytämälläsi alkukirjaimella "{{ letter }}"!</span>{% endif %} {# TODO: translate #}
	     <span class="header-text-small-font-nobold" id="download-text">Lataa tämä sanasto SKOS-muodossa: <a href="{{ path_fix }}{{ vocab_id }}/rdfxml">RDF/XML</a> <a href="{{ path_fix }}{{ vocab_id }}/data/turtle">Turtle</a></span>
   </div>
  
{% endblock %}
